<?php if(count($products) > 0):?>
<div class="row-fluid">
    <h1 style="font-size: 18px;color: #DA251E;padding-left: 10px;"><?php echo $title;?></h1>
</div>
<?php 
    $count = 0;
    $count_products = count($products);
    foreach ($products as $product):
        $uri = get_base_url() . url_title($product->category, 'dash', TRUE) . '-c' . $product->categories_id . '/' . get_uri_product($product->product_name, $product->id);
        $image = ($product->image_name != '' || $product->image_name != NULL) ? '/images/products/' . $product->image_name : '/images/no_image.jpg'
?>
    <?php if($count % 3 == 0):?>
        <div class="row-fluid list_pr">
    <?php endif;?>
        <div class="span4 kh_sp">
            <a href="<?php echo $uri;?>"><img class="img_st" src="<?php echo $image;?>" alt=""></a>
            <h2 class="tt_sp"><a href="<?php echo $uri;?>"><?php echo $product->product_name;?></a></h2>
        </div>
    <?php  $count++; if($count % 3 == 0):?>
        </div>
    <?php endif;?>
<?php endforeach;?>
<?php if($count_products % 3 != 0):?>
</div>
<?php endif;endif;?>

<div class="fright pull-right">
<?php echo isset($pagination) ? '<div class="pagination">' . $pagination . '</div>' : '';?>
</div>